package com.huping.mapper;

import com.alibaba.fastjson.JSONObject;
import com.huping.pojo.Student;
import com.huping.pojo.Teacher;
import com.huping.pojo.User;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
public interface UserMapper {



    @Select("select * from user where userid = #{userid} and password = #{password}")
    User getByUsernameAndPassword(User user);

    @Insert("insert into user (userid, password,kind) VALUES (#{userid},#{password},#{kind})")
    int userInsert(User user);

    @Select("select count(*) from user where userid = #{userid} ")
    long getByUserid(@Param("userid") String userid);

     @Update("update  user set password=#{password} where userid=#{userid}")
     int updateUserPassword(User user);


     @Select("select password from user where userid=#{userid}")
     String getUserPassword(@Param("userid") String userid);












}
